<?php //pack11class

class MainBlock extends Module {

    public $traceEnabled=true;

    public function setup() {
        if(is_numeric(SettingsManager::getSetting("object")->value)) {
            $this->addChild(new ObjectCard);
            $this->addChild(new ObjectCardPrintable);
        } else {
            $setting=SettingsManager::getSetting("page");
            if($setting->value) {
                $page=PagesManager::getPage($setting->value);
                $className=$page->className;
                $this->addChild(new $className);
            } else {
                $this->addChild(new ObjectsList);
            }
        }
    }

}
?>
